<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<%@page import="java.sql.Connection,
java.sql.PreparedStatement,
java.sql.ResultSet,
java.sql.SQLException,
java.sql.Statement,
java.util.ArrayList,
java.util.Date,
java.util.List"
%>
<%@page import= "edu.gdut.imis.goods.common.*"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>会员信息</title>
    <link rel="shortcut icon" href="favicon1.ico" />
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/register.css">
    <style>
        table{
            border: 1px solid black;
            margin: 200px auto;
        }
        td{
            border: 1px solid black;
            height: 38px;
            width: 58px;
            text-align: center;
        }
    </style>
</head>
<body>
    <table>
        <tr>
            <td></td>
            <td>ID</td>
            <td>名称</td>
            <td>地址</td>
            <td>手机</td>
            <td>邮箱</td>
            <td>状态</td>
            <td></td>
        </tr>
	<%
	
	
	response.setContentType("text/html;charset=utf-8");
	request.setCharacterEncoding("utf-8");
	int uid= 0;
	String name = null;
	String password = null;
	String address = null;
	String mobile = null;
	String email = null;
	int status = 0;
	
	
	
		Connection conn = null;
		Statement stmt = null;
	
		
		try {
		
			conn = DBConnector.getConn();
	
	
			String sql = "SELECT* FROM user_info";
		
		
			stmt = conn.createStatement();
			ResultSet rs = stmt.executeQuery(sql);

				while(rs.next()){
				uid = rs.getInt(1);		
				
				name = rs.getString(2);
			
				//session.setAttribute("name", name);
				password = rs.getString(3);
				//session.setAttribute("password", password);
			
				address = rs.getString(4);
			
				//session.setAttribute("address", address);
				mobile =rs.getString(5);	
				//session.setAttribute("mobile", mobile);
				email =rs.getString(6);	
				//session.setAttribute("email", email);
    			status = rs.getInt(7);
    			//session.setAttribute("status", status);
    				%>
    				<tr>
                        <td><a href="/Goods/UpdateUserServlet?id=<%=uid%>&update=1" style="color: cornflowerblue;">解冻</a></td>
                        <td><%=uid%></td>
                        <td><%=name%></td>
                        <td><%=address%></td>
                        <td><%=mobile%></td>
                        <td><%=email%></td>
                        <td><%=status%></td>
                        <td><a href="/Goods/UpdateUserServlet?id=<%=uid%>&update=0" style="color: cornflowerblue;">冻结</a></td>
                    </tr>
    				<%
				}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		try {
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		

	
	
	%>
</table>
</body>
</html>